package com.bookstore.service.impl;

import com.bookstore.domain.Address;
import com.bookstore.mapper.AddressMapper;
import com.bookstore.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl implements AddressService {
    @Autowired
    private AddressMapper addressMapper;

    @Override
    public List<Address> findAllByUid(Integer uid) {
        return addressMapper.findByUid(uid);
    }

    @Override
    public int addAddress(Address address) {
        return addressMapper.addAddress(address);
    }

    @Override
    public Address getOneAddress(Integer addressId) {
        return addressMapper.getOneById(addressId);
    }

    @Override
    public int upAddress(Address address) {
        return addressMapper.upAddress(address);
    }

    @Override
    public int delAddress(Integer addressId) {
        return addressMapper.delAddress(addressId);
    }
}
